﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _024
{
    struct Books
    {
        public string title;
        public string author;
        public string subject;
        public int book_id;

        public void getValue(string t,string a,string s,int id)
        {
            title = t;
            author = a;
            subject = s;
            book_id = id;
        }
        public void disPlay()
        {
            Console.WriteLine("Title:{0}",title);
            Console.WriteLine("Author:{0}",author);
            Console.WriteLine("Subject:{0}",subject);
            Console.WriteLine("Book_id:{0}",book_id);
        }
    }//定义结构体
    internal class Program
    {
        static void Main(string[] args)
        {
            #region
            /*
            string a = "a,b,c,d,e,f,h";
            string b = "a,b,c,d,e,f,g";
            List<string> select_operation = new List<string>();
            string[] sel_arr = a.Split('，');
            IEnumerable<string> nameQuery = from name in sel_arr select name;
            string result = "";
            foreach (string tt in nameQuery)
            {
                if (!b.Contains(tt))
                {
                    result += tt + ";";
                }
            }
            result = result.Substring(0, result.Length - 1);
            Console.WriteLine(result);
            Console.ReadKey();
            */
            #endregion
            #region
            /*
            Books book1;
            Books book2;
            //定义book1的属性
            book1.title = "语文";
            book1.author = "数学";
            book1.subject = "英语";
            book1.book_id = 123;
            //定义book2的属性
            book2.title = "http教程";
            book2.author = "C语言中文网";
            book2.subject = "http协议教程";
            book2.book_id = 456;
            //输出book1的属性信息
            Console.WriteLine("book1 title：{0}",book1.title);
            Console.WriteLine("book1 author:{0}",book1.author);
            Console.WriteLine("book1 subject:{0}",book1.subject);
            Console.WriteLine("book1 book_id:{0}",book1.book_id);
            //输出book2的属性信息
            Console.WriteLine("book2 title:{0},book2 author:{1},book2 subject:{2},book2 book_id:{3}",book2.title,book2.author,book2.subject,book2.book_id);
            */
            #endregion
            Books book1 = new Books();//实例化Books结构体
            Books book2 = new Books();//实例化Books结构体
            book1.getValue("C#教程", "C语言中文网", "C#编程教程", 1234);
            book2.getValue("http教程", "c语言中文网", "HTTP协议教程", 5678);
            book1.disPlay();
            book2.disPlay();
            Console.ReadKey();
        }
    }
}
